** This file creates Figure 6.1

* Open UMASS CCES module from 2012
use CCES12_umass_module.dta, clear

* Combine the two versions of the variables into one variable
forvalues i = 1(1)5 {
replace UMA408_`i'=UMA408_`i'_1 if UMA408_`i'==.
}

* Rename the variables
ren UMA408_1 freedom
ren UMA408_2 nounequalinfluence
ren UMA408_3 reducecorruption
ren UMA408_4 competition
ren UMA408_5 transparency

* Set the weights
svyset [pw=weight_vv]

* Generate mean ranking for each item
svy: mean reducecorruption nounequalinfluence transparency competition freedom

* Save means into a dataset for graphing
parmest, saving(tograph, replace)

* Open dataset for graphing
use tograph, clear
gen xaxis=(6-_n)

* Create Figure 6.1
twoway bar estimate xaxis, hor xlabel(1 2 3 4 5) ylabel(5 "Reduce Corruption" 4 "Prevent Unequal Influence" 3 "Ensure Transparency" 2 "Promote Competition" 1 "Preserve Freedom", angle(0)) ytitle(" ") xtitle("Average Ranking") barw(.5) bc(black)
graph export fig_6_1.eps, replace
